{% extends "iphone/base.html" %}

{% block extrahead %}
<script type='text/javascript' src='/appmedia/js/jquery_min.js'></script>

<script language="JavaScript" type="text/javascript">
function ChangeNumber(delta, id) {
var val = $("#"+id).val();
	if (val=="") {
		var num = 0.0 + delta;
	}
	else {
		var num = parseFloat(val) + delta;
	}
	if (num < 0.0) { num=0; }
	$("#"+id).val(num.toFixed(2));
}
	
$(function() {
   	$("input.vFloatField").each(function(){
        if($(this).val()=="") {$(this).val(0);}
        $(this).after('<a href="javascript:ChangeNumber(-0.5, ' + "'" + this.id + "'" +')">-0.5</a>');
   		$(this).after(' <a href="javascript:ChangeNumber(0.5, ' + "'" + this.id + "'" +')">+0.5</a> / ');
   	});
   	
   	$("input.vDateField").each(function(){
        $(this).after('<span style="font-size:x-small">i.e. 2008-07-22</span>');
   	});
   	
   	document.getElementById('id_text').className = 'autoExpand';
});
</script>

<script type='text/javascript' src='/appmedia/js/autoexpand.js'></script>
{% endblock %}

{% block content %}
<div class="header">
{% if item %}
Edit {{model_name|lower}}
{% else %}
New {{model_name|lower}}
{% endif %}
 :: <a href="/iphone/">Return to Whiteboard</a>
</div>

{% if item %}
<form id="new_item" method="post" action="/iphone/task/edit/{{item.id}}/">
{% else %}
<form id="new_item" method="post" action="/iphone/task/add/">
{% endif %}
<table cellpadding="0" class="tab">
{{form}}
<input id="save_and_stay" name="save_and_stay" type="hidden" value="">
</table>
<input name="submit" type="submit" class="s" value="Save task" />
 :: <a href="/iphone/">Cancel</a>
</form>
{% endblock %}

{% block analytics %}
	<!-- We don't need to give Google this content. Analytics is of. -->
{% endblock %}
